﻿//图片服务器地址
{var url='http://www.yzmanga.com/comicdata/';}
//屏蔽右键复制
function click(e) {
	if (document.all) {
		if (event.button==1||event.button==2||event.button==3){oncontextmenu='return false';}
	}
	if (document.layers){
		if (e.which == 3){oncontextmenu='return false';}
	}
}


if (document.layers){document.captureEvents(Event.MOUSEDOWN);}
document.onmousedown=click;
document.oncontextmenu = new Function("return false;")
var travel=true
var hotkey=17   /* hotkey即为热键的键值,是ASII码,这里99代表c键 */
if (document.layers){document.captureEvents(Event.KEYDOWN);}



function gogo(e)
{
	if (document.layers) {
		if (e.which==hotkey&&travel){return false;}
	}
	else if (document.all){
		if (event.keyCode==hotkey&&travel){return false;}
	}
}
document.onkeydown=gogo

function bbimg(o){
	if (window.navigator.userAgent.indexOf("MSIE")>=1){
	var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if(zoom<50) zoom=50;if (zoom>0) o.style.zoom=zoom+'%';
	return false;
	}else{
	return false;	
	}
}
function zoomd(){
	if (window.navigator.userAgent.indexOf("MSIE")>=1){
		document.getElementById("Img").style.zoom = "100%";
		document.getElementById("Img").style.width="auto";
	}else{
		document.getElementById("Img").style.width="auto";
	}
}
function zoomx(){
	if (window.navigator.userAgent.indexOf("MSIE")>=1){
		document.getElementById("Img").style.zoom = "100%";
		document.getElementById("Img").style.width="880";
	}else{
		document.getElementById("Img").style.width="880";
	}
}
//if(document.getElementById("Img") && document.getElementById("Img").width>880){
//	document.getElementById("Img").style.width="880";
//}
//Vol Page
var current;
var re = /^[1-9]+[0-9]*]*$/;
var jsstr;
var imgsrc;
var imgl;
var total;
var tpf;
var Img;
var ImgHref;
if(location.href.indexOf('?')>0){
current = location.href.substr(location.href.indexOf('?')+1);
if (!re.test(current)){current = 1;}
if(current > total){current = total;}
}else{current = 1;}
current = Math.floor(current);
current2 = current+1
if(current2 > total){current2 = total;}
current3 = current
current4 = current3
imgsrc = current.toString();
imgsrc2 = current2.toString();
imgsrc3 = current3.toString();
imgsrc4 = current4.toString();
imgl = imgsrc.length;
imgl2 = imgsrc2.length;
imgl3 = imgsrc3.length;
imgl4 = imgsrc4.length;
if(imgl<tpf+1){for(i=1;i<=(tpf+1-imgl);i++){
imgsrc = '0' + imgsrc;}}
if(imgl2<tpf+1){for(i=1;i<=(tpf+1-imgl2);i++){
imgsrc2 = '0' + imgsrc2;}}
if(imgl3<tpf+1){for(i=1;i<=(tpf+1-imgl3);i++){
imgsrc3 = '0' + imgsrc3;}}
if(imgl4<tpf+1){for(i=1;i<=(tpf+1-imgl4);i++){
imgsrc4 = '0' + imgsrc4;}}
	jsstr = ' <font color=red>提示:①点击图片或者按“Ctrl”键进行下一页 ②图片可上下左右拖动 </font><br><br>';

document.getElementById('Img').src = url + volpic +  imgsrc + '.jpg';
document.getElementById('Img2').src = url + volpic + imgsrc2 + '.jpg';

if (document.getElementById('volpage')){

jsstr += '<a href="?" disabled="disabled"><IMG height=20 alt=上一页 src="/images/fir.gif" width=70 align=absMiddle border=0></a> '
jsstr += '<a href="?'+ (current-1) +'"><IMG height=20 alt=上一页 src="/images/pre.gif" width=70 align=absMiddle border=0></a>'
jsstr += ' <select name="select2" style="line-height:25px;" onChange="window.location.href=this.options[this.selectedIndex].value">';
for(i=1;i<=total;i++){
jsstr += '<option value="?'+i+'"';	
if(current == i){jsstr += ' style="color:#FF0000;" selected';}
jsstr += '>第'+ i +'页</option>';}	
jsstr += '</select> ';
if (current==total){jsstr += '<IMG height=20 alt=下一页 src="/images/next.gif" width=70 align=absMiddle border=0>';}else{jsstr += '<a href="?'+(current+1)+'"><IMG height=20 alt=下一页 src="/images/next.gif" width=70 align=absMiddle border=0></a>';}
jsstr += '  <a href="?'+(total)+'" disabled="disabled"><IMG height=20 alt=上一页 src="/images/last.gif" width=70 align=absMiddle border=0</a>';
jsstr += ' <a href="../"><IMG height=19 alt=返回目录 src="/images/btn_ml.gif" width=87 align=absMiddle border=0></a>';
	document.getElementById("volpage").innerHTML = jsstr;
	document.getElementById("volpage2").innerHTML = jsstr;	
}

//document.getElementById("vol_banner2").innerHTML = "<br><iframe border=0 frameborder=0 scrolling=no width=900 height=80 src=\"/js/vol_banner2.htm\"></iframe>";

//document.getElementById("vol_banner3").innerHTML = "<br><iframe border=0 frameborder=0 scrolling=no width=900 height=160 src=\"/js/vol_banner3.htm\"></iframe>";
function jumpPage() {
if (event.keyCode==17) location='?'+ (current+1) +'';if (event.keyCode==13) location='../';if (event.keyCode==16) location='?'+ (current-1) +'';
}
document.onkeydown=jumpPage;
var jsstr;
